<?php

namespace common\models\folder;

use Yii;

/**
 * This is the model class for table "{{%member_account}}".
 *
 * @property int $id
 * @property string $member_id
 * @property string $amount 历史累积
 * @property string $current 当前账户
 * @property string $withdraw 历史提现总额
 * @property int $last_draw 上次提现金额
 * @property string $created_at
 * @property string $updated_at
 * @property int $status 账户状态：-1账户冻结，0未激活，10正常
 */
class MemberAccount extends \common\db\ActiveRecord {

    use \common\traits\Constants;

    CONST STATUS_ACTIVED = 10;
    CONST STATUS_DEFAULT = 0;
    CONST STATUS_FREEZED = -1;
    CONST STATUS_FORBID = -1;

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return '{{%member_account}}';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['member_id', 'amount', 'current', 'withdraw', 'last_draw', 'created_at', 'updated_at', 'status'], 'integer'],
            [['member_id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'member_id' => 'Member ID',
            'amount' => '历史累积',
            'current' => '当前账户',
            'withdraw' => '历史提现总额',
            'last_draw' => '上次提现金额',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'status' => '账户状态：-1账户冻结，0未激活，10正常',
        ];
    }

}
